<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>
    // 1. 随机10个0 - 100的数 依次按顺序放到数组中

    var list = []; // len:0  
    for (var i = 0; i < 10; i++) {
        var num = Math.round(Math.random() * 100);
        list[list.length] = num;
    }
    console.log(list);


    // 2. 求10个数的和 以及 平均值
    var sum = 0;
    for (var i = 0; i < list.length; i++) {
        var item = list[i];
        sum += item;
    }
    var avg = sum / list.length;
    console.log(sum, avg);

    // 3.  把大于平均值的数 放到新数组中
    var arr = [];
    for (var i = 0; i < list.length; i++) {
        var item = list[i];
        if (item > avg) {
            arr[arr.length] = item;
        }
    }
    console.log(arr);





</script>

</html>